<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath}/themes/icon.css"
	rel="stylesheet">
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
   $(function() {
		//配置搜索框
		$('#findusername').searchbox({
			searcher : function(value, name) {
				var username = value;
				$('#usertable').datagrid('reload', {
					searchname : username
				});
			}
		});
		//配置数据表格
		$('#usertable').datagrid({
			url : '${pageContext.request.contextPath}/findallusers',
			columns : [ [{
				field : 'userid',
				title : '用户编号',
				width : 100,
				hidden : true
			}, {
				field : 'username',
				title : '用户姓名',
				width : 100
			}, {
				field : 'userphone',
				title : '用户电话',
				width : 100,
				align : 'right'
			}, {
				field : 'useraddr',
				title : '用户地址',
				width : 100,
				align : 'right'
			},] ],
			pagination : true,
			striped : true,
			rownumbers : true,
		});
		
	});
</script>
<body>
<div style="margin-bottom:30px;margin-top:20px;margin-left:20px">
	<input style="width:200px;height:30px" id="findusername" class="easyui-searchbox" data-options="prompt:'输入姓名查询信息',width:150">
</div>
	
	<table id="usertable" style="width:500px"></table>
</body>
</html>